package com.whmskj.xjlhsc.mobie.equipmentManage.controller;

import com.whmskj.xjlhsc.controller.vo.Result;
import com.whmskj.xjlhsc.mobie.equipmentManage.entity.vo.MachineComparisonVO;
import com.whmskj.xjlhsc.mobie.equipmentManage.service.IMachineComparisonService;
import com.whmskj.xjlhsc.mobie.equipmentManage.service.imp.MachineComparisonServiceImpl;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;
import java.util.List;

/**
 * @author jiaruchun
 * @date 2025-09-01 14:40
 */
@RestController
@Api(tags = "机台对比接口")
@RequestMapping("/mob/machineComparison")
public class MachineComparisonController {

    @Autowired
    private IMachineComparisonService machineComparisonService;
    @GetMapping
    public Result machineComparison(@RequestParam(value = "mesId",required = false) Integer mesId,
                                    @RequestParam(value = "mesId2",required = false)Integer mesId2,
                                    @RequestParam(value = "start",required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate start,
                                    @RequestParam(value = "end",required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate end
                                    ) {
        return Result.success(machineComparisonService.machineComparison(mesId,mesId2,start, end));
    }
}
